﻿using System.Windows;
using System.Windows.Controls;
using System.IO.IsolatedStorage;
using Zeus.Classes;

namespace Zeus.UserControls
{
    public partial class OpenProjectChildWindow : ChildWindow
    {
        public OpenProjectChildWindow()
        {
            InitializeComponent();
            IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
            string [] s = isoStore.GetDirectoryNames();
            for(int i =0;i<s.Length;i++)
            {
                ListProject.Items.Add(s[i]);
            }
        }

        private void OkButtonClick(object sender, RoutedEventArgs e)
        {
            Project.OpenProject(ListProject.SelectedItem.ToString());
            DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
        }
    }
}